package uk.ac.aber.Blockmation.old;

//~--- JDK imports ------------------------------------------------------------

import uk.ac.aber.Blockmation.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagLayout;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSpinner;

public class CenterBottomPanel2 extends JPanel {
    private JLabel    animationControlLabel;
    private JLabel    blockSizeLabel;
    private JSpinner  blockSizeSpinner;
    private JButton   currentFrameButton;
    private JButton   firstFrameButton;
    private JButton   lastFrameButton;
    private MainFrame mainFrame;    // ?
    private JButton   nextFrameButton;
    private JButton   previousFrameButton;

    public CenterBottomPanel2(MainFrame mainFrame) {
        this.setBorder(BorderFactory.createRaisedBevelBorder());
        this.mainFrame        = mainFrame;
        animationControlLabel = new JLabel("Animation Controller");
        firstFrameButton      = new JButton("First Frame");
        previousFrameButton   = new JButton("Previous Frame");
        currentFrameButton    = new JButton("Current Frame");
        nextFrameButton       = new JButton("Next Frame");
        lastFrameButton       = new JButton("Last Frame");
        firstFrameButton.setMaximumSize(new Dimension(30, 30));
        previousFrameButton.setMaximumSize(new Dimension(30, 30));
        currentFrameButton.setMaximumSize(new Dimension(50, 50));
        nextFrameButton.setMaximumSize(new Dimension(30, 30));
        lastFrameButton.setMaximumSize(new Dimension(30, 30));

//      //Panel holding label
        JPanel animationPanel = new JPanel();

        animationPanel.setLayout(new BoxLayout(animationPanel, BoxLayout.Y_AXIS));
        animationPanel.add(animationControlLabel);
        animationPanel.add(Box.createRigidArea(new Dimension(0, 10)));
        this.add(animationPanel);

//      //Panel holding animation butons
        JPanel animationPanel2 = new JPanel();
        animationPanel2.add(Box.createRigidArea(new Dimension(0, 10)));
        
        animationPanel2.setLayout(new BoxLayout(animationPanel2, BoxLayout.X_AXIS));
        animationPanel2.add(Box.createRigidArea(new Dimension(5, 0)));
        animationPanel2.add(firstFrameButton);
        animationPanel2.add(Box.createRigidArea(new Dimension(5, 0)));
        animationPanel2.add(previousFrameButton);
        animationPanel2.add(Box.createRigidArea(new Dimension(5, 0)));
        animationPanel2.add(currentFrameButton);
        animationPanel2.add(Box.createRigidArea(new Dimension(5, 0)));
        animationPanel2.add(nextFrameButton);
        animationPanel2.add(Box.createRigidArea(new Dimension(5, 0)));
        animationPanel2.add(lastFrameButton);
        animationPanel2.setAlignmentX(this.CENTER_ALIGNMENT);
        this.add(animationPanel2);

//      // this.setBackground(Color.yellow);
        this.setVisible(true);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
